<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>
    <link rel="stylesheet" href="/dev/views/slx/layui/css/layui.css">
</head>
<body>
<div id="demo-laypage-all" style=" margin: auto;"></div>
<script src="/dev/views/slx/layui/layui.js" type="text/javascript"></script>
<script>
      layui.use(function(){
          console.log("进入分页")
          var laypage = layui.laypage;
          $.get(`/dev/song/search/${titles}/1/20`,function(result){
              loadData(result.data.list)
              console.log(result.data)
              console.log(result.data.list)
              console.log("====================")
              laypage.render({
                  elem: 'demo-laypage-all',
                  count: `${result.data.total}`, // 数据总数
                  pageNum: result.data.pages,
                  current: result.data.pageNum,
                  limits:[2,4,8,10,20],
                  layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'], // 功能布局
                  jump: function(obj){
                      $.get(`/dev/song/search/${titles}/${obj.curr}/${obj.limit}`,function(result){
                          console.log("====================")
                          console.log(obj.curr)
                          console.log(obj.limit)
                          console.log(result.data)
                          console.log("=================")
                          console.log("--------------")
                          str=result.data.list
                          console.log("再一次，下一页")
                          loadData(str)
                      })
                      console.log(obj.curr);
                  }
              });
          })
      });
</script>
</body>
</html>